home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 July / Disc 1 / PCU0703CD1.iso / software / online / files / imacros.exe / CSV-2-WEB.VBS < prev    next >
Encoding:
Text File  |  2003-04-04  |  911 b   |  34 lines

  1. Option Explicit
  2.  
  3. MsgBox ("This example script reads information from a csv file and submits it to a web form." )
  4.  
  5. 'Tip: For more information on the method used here
  6. 'search for "Text File Driver" and "Schema.ini" in any search engine
  7.  
  8.  
  9. Dim iim1, i, iret
  10.  
  11. set iim1= CreateObject ("iimwsh.iim")
  12. iret = iim1.iimInit
  13. iret = iim1.iimDisplay("Submitting Data")
  14.  
  15. 'Note: The input file name and the number of columns are specified in the macro
  16. 'You can also specify them inside the script with "iimSet"
  17.  
  18. 'Loop through the input file
  19. 'We start at "2" to skip the first header line in the file
  20. for i = 2 to 4
  21.    'Set the current read position
  22.    iret = iim1.iimSet("-var_line", cstr(i))
  23.  
  24.    'Run the macro
  25.    iret = iim1.iimPlay("wsh-csv-2-web")
  26.    If iret < 0 Then
  27.       MsgBox iim1.iimGetLastMessage()
  28.    End If
  29. next
  30.  
  31. iret = iim1.iimDisplay("Done!")
  32. iret = iim1.iimExit
  33. WScript.Quit(0)
  34.